import akshare as ak

index_stock_cons_df = ak.index_stock_cons(symbol="000300")

# 创建一个空列表，用于存储股票代码
stock_codes = []
for stock in index_stock_cons_df['品种代码']:
    stock_codes.append(stock)

# 打印股票代码列表
print(stock_codes)